#include "OpenclEnv.h"

using namespace std;

OpenclEnv::OpenclEnv()
{
	this->outbuffer_size = new unsigned[4];
	for(int i=0;i<2;++i)
		this->outbuffer_size[i] = 64 * 1024 * 1024; //64MB
	for(int i=2;i<4;++i)
		this->outbuffer_size[i] = 8 * 1024 * 1024; //8MB
}

OpenclEnv::~OpenclEnv()
{
	delete this->contexts;
	delete this->commands;
	delete this->program;
	delete this->kernel;
	delete this->arg_index;
	delete this->outbuffer_size;
	for (int i = 0; i < (int)this->num_devices; ++i)
	{
		delete this->offset_in[i];
		delete this->adjacency_in[i];
	}
	delete this->buffer1_in;
	delete this->buffer2_in;
	delete this->buffer3_in;
	delete this->buffer_out;
}